﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DevelopmentPFR.Utilitaire;

namespace DevelopmentPFR.Plateforme_Stockage
{
    public partial class BonsCommandes : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                ListeCommandeCA.DataSource = BaseDeDonnees.ExecuteSelectStoredProcedure("spPs_commandeCaReception");
                ListeCommandeCA.DataBind();
                foreach (GridViewRow row in ListeCommandeCA.Rows)
                {
                    ((HyperLink)row.FindControl("linkReference")).NavigateUrl = "BonsReceptions.aspx?ref=" + row.Cells[0].Text;
                }
            }
        }

        protected void gridviewReceptionComande_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "ReceptionCommande")
            {

                int indexLine = Convert.ToInt32(e.CommandArgument.ToString());
                string reference = ListeCommandeCA.DataKeys[indexLine]["refCommandeCa"].ToString();
                //BoundField referenceCa = (BoundField)ListeCommandeCA.Rows[indexLine].FindControl("refCommandeCa");

            }
        }
    }
}